package nori6_common_protocol;

import java.io.IOException;
import java.io.StringWriter;

import org.json.simple.JSONObject;

public class Nori6OutgoingMessage extends Nori6Message 
{
	public Nori6OutgoingMessage()
	{
		m_Json = new JSONObject();
		
	}
	public void SetField(String key, Object value)
	{
		m_Json.put(key, value);
	}	
	
	public void SetController(NORI6_CONTROLLER_TYPE type)
	{
		m_Json.put(ctrl_key, type.ordinal());
	}
	
	public String GetString()
	{
		StringWriter out = new StringWriter();
		try 
		{
			m_Json.writeJSONString(out);
		} 
		catch (IOException e) 
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		String jsonText = out.toString();
		return jsonText;
	}
}
